<template>
  <TresAxesHelper :scale="new THREE.Vector3(10, 10, 10)"></TresAxesHelper>
  <TresAmbientLight></TresAmbientLight>
  <TresOrbitControls
    v-if="camera && renderer"
    :args="[camera, renderer?.domElement]"
  ></TresOrbitControls>
</template>

<script setup lang="ts">
import * as THREE from "three";
import { useLoader, useTresContext, extend, useRenderLoop } from "@tresjs/core";
import { OrbitControls } from "three/addons/controls/OrbitControls";

extend({ OrbitControls });
const { scene, camera, renderer } = useTresContext();
const { onLoop } = useRenderLoop();
/**
 * 设置场景
 */
const setScence = () => {
  scene.value.background = new THREE.Color("black");
};
setScence();
onLoop(({ delta, elapsed }) => {
  renderer.value.shadowMap.enabled = true;
});
</script>

<style scoped></style>
